<template>
  <ul class="todo-list">
    <!-- completed: 完成的类名 -->
    <li :class="item.value ? 'completed': ''" v-for="(item,index) in list1" :key="index">
      <div class="view" >
        <input class="toggle" type="checkbox" v-model="item.value" />
        <label>{{item.name}}</label>
        <button class="destroy" @click="delFn(index)"></button>
      </div>
    </li>
  </ul>
  
</template>

<script>
export default {
  data() {
    return {

    }
  },
  computed: {
    list1() {
      return this.$store.state.getList.list1
    }
  },
  methods: {
    delFn(index) {
      this.$store.commit('getList/delList', index)
    }
  }
}
</script>
